/*
 * Powered By [fdlm]
 * Web Site: http://www.fdlm.cn
 * Since 2014 - 2015
 */

package com.sjyy.configuration.model;

import javacommon.base.BaseEntity;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;

/**
 * @author cty email:seal100x@163.com
 * @version 1.0
 * @since 1.0
 */


public class Configuration extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Configuration";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_RELATION_CITY = "relationCity";
	public static final String ALIAS_RELATION_KEY = "relationKey";
	public static final String ALIAS_RELATION_VALUE = "relationValue";
	
	//date formats
	
	//columns START
    /** id       db_column: ID */	
	
	private java.lang.Integer id;
    /** relationCity       db_column: relation_city */	
	
	private java.lang.Integer relationCity;
    /** relationKey       db_column: relation_key */	
	@Length(max=32)
	private java.lang.String relationKey;
    /** relationValue       db_column: relation_value */	
	@Length(max=16777215)
	private java.lang.String relationValue;
	//columns END

	public Configuration(){
	}

	public Configuration(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setRelationCity(java.lang.Integer value) {
		this.relationCity = value;
	}
	
	public java.lang.Integer getRelationCity() {
		return this.relationCity;
	}
	public void setRelationKey(java.lang.String value) {
		this.relationKey = value;
	}
	
	public java.lang.String getRelationKey() {
		return this.relationKey;
	}
	public void setRelationValue(java.lang.String value) {
		this.relationValue = value;
	}
	
	public java.lang.String getRelationValue() {
		return this.relationValue;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("RelationCity",getRelationCity())
			.append("RelationKey",getRelationKey())
			.append("RelationValue",getRelationValue())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Configuration == false) return false;
		if(this == obj) return true;
		Configuration other = (Configuration)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

